package cn.cloudplug.core.index;

import android.content.Context;
import android.os.Handler;

import static cn.cloudplug.core.index.Configurator.*;

/**
 * Created by pc on 2018/1/18.
 */

public class Scent {
    public static Configurator init(Context context){
        return getInstance().withAppContext(context.getApplicationContext());
    }
    public static Handler mianHandler(){
        return getInstance().getMainHandler();
    }

    public static Configurator getConfigurator(){
        return getInstance();
    }

    public static Context getAppContext(){
        return getConfiguration(ConfigKeys.AppContext);
    }

    public static <T> T getConfiguration(Object key){
        return (T) getInstance().getConfiguration(key);
    }

    public static void put(Object k,Object v){
        getInstance().put(k, v);
    }

    public static <T> T get(Object k){
        return getInstance().get(k);
    }
}
